<!-- 页面 -->
<template>
    <div>
        <div class="hang1">
            <img src="../../../public/img/1.png" alt="" width="100%">
            <van-tabs class="zs">
                <van-tab v-for="item in list1" :key="item.id" :title="item.catename">
                    <!-- {{ item.catename }} -->
                </van-tab>
            </van-tabs>
            <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
                <van-swipe-item v-for="item in list2" :key="item.id">
                   <img src="../../../public/img/2.png" alt="" height="200px">
                </van-swipe-item>
            </van-swipe>
            <img src="../../../public/img/4.png" alt="" width="100%">
            <img src="../../../public/img/微信图片_20221222192120.png" alt="" width="100%">
        </div>
    </div>
</template>
<!--vue -->
<script>
export default {
    name: "homeIndex",
    //存放数据
    data() {
        return {
            //声明的属性
            list1: [],
            list2: [],
            list3: []
        }
    },
    created() {
        this.getList1()
        this.getList2()
        this.getList3()
    },
    //生命周期函数
    mounted() {
    },
    //调用方法
    methods: {
        async getList1() {
            let res = await this.$http.get('/getcate')
            // console.log(res);
            let { data } = res.data;
            this.list1 = res.data.list
            // console.log(this.list1);
        },
        async getList2() {
            let res = await this.$http.get('/getbanner')
            // console.log(res);
            let { data } = res.data;
            this.list2 = res.data.list
            // console.log(this.list2);
        },
        async getList3() {
            let res = await this.$http.get('/getseckill')
            console.log(res);
            // let { data } = res.data;
            // this.list2 = res.data.list
            // console.log(this.list2);
        }
    },
    //监听器
    watch: {},
    //计算属性
    computed: {},
    //过滤器
    filters: {},
    //自定义指令
    directives: {},
}
</script>
<!-- css样式 -->
<style>
.zs {
    width: 100%;
}
</style>